<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>管理界面</title>
    <div th:include="common::css"></div>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">酒店预订系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">

        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a th:href="@{/room/toList}">酒店</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;" th:text="${session.loginUser.getName()}">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img" >

                </a>
            </li>
            <li class="layui-nav-item"><a th:href="@{/user/loginOut}" onclick="return confirm('您确定退出登录吗？');">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">

                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">用户</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="\manage\manageuser"  target="_top" >用户管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">订单管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="\manage\managebook"  target="_top" >订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">房间管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="\manage\manageroom"  target="_top" >房间</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="main_right">
            <iframe frameborder="0" scrolling="yes" style="width: 100%" src="" id="aa">
            </iframe>
        </div>
    </div>
    <div class="layui-footer">
    </div>
</div>











<div th:include="common::js"></div>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

        //监听导航点击
        element.on('nav(demo)', function(elem){
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>

<script >
    $(function(){
        //获取src值
        $(".main_left a").on("click",function(){
            var address =$(this).attr("data-src");
            $("iframe").attr("src",address);
        });
        //一下代码是根据窗口高度在设置iframe的高度
        var frame = $("#aa");

        var frameheight = $(window).height();
        console.log(frameheight);
        frame.css("height",frameheight);


    });
</script>
</body>
</html>